import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('jobs_failed')
export class JobsFailed {
  @PrimaryGeneratedColumn({
    name: 'id',
    type: 'int',
  })
  id: number;

  @Column({
    name: 'connection',
    type: 'text',
    nullable: false,
  })
  connection: string;

  @Column({
    name: 'queue',
    type: 'text',
    nullable: false,
  })
  queue: string;

  @Column({
    name: 'payload',
    type: 'longtext',
    nullable: false,
  })
  payload: string;

  @Column({
    name: 'exception',
    type: 'longtext',
    nullable: false,
  })
  exception: string;

  @Column({
    name: 'fail_time',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
    nullable: false,
  })
  failTime: Date;
}